using System;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Matrix.Notification.Domain.Notifications;

namespace Matrix.Notification.EntityFrameworkCore
{
    [ConnectionStringName("Default")]
    public class NotificationDbContext : AbpDbContext<NotificationDbContext>
    {
        public DbSet<Notification> Notifications { get; set; }
        public DbSet<NotificationTemplate> NotificationTemplates { get; set; }
        public DbSet<NotificationBatch> NotificationBatches { get; set; }
        public DbSet<NotificationSubscription> NotificationSubscriptions { get; set; }

        public NotificationDbContext(DbContextOptions<NotificationDbContext> options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);

            builder.ConfigureNotification();
        }
    }
}